package com.xp.basic.heima.nio.netty.simpledemo.chat.service;

public class HelloServiceFactory {

    public static HelloService getHelloService() {
        return new HelloServiceImpl();
    }


    public static <T> T getProxyObject(Class<T> tClass){
        try {
            return tClass.newInstance();
        } catch (InstantiationException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

    public static void main(String[] args) throws ClassNotFoundException {
        HelloService proxyObject = getProxyObject(HelloServiceImpl.class);
        proxyObject.sayHello("xiaoming ");
    }
}
